<template>
	<view>
		<van-nav-bar @click-left="$back" left-arrow title="备注" :border="false" />
		<scroll-view scroll-y :style="{height: height, backgroundColor: '#f8f8f8'}">
			<view style="padding: 32rpx;">
				<van-field
					title-width="60rpx"
					size="large"
				    :value="remark"
				    label="备注"
				    type="textarea"
				    placeholder="请输入备注"
				    :autosize="{ minHeight: '50px' }"
					maxlength="50"
					show-word-limit
					@change="handleChange"
				  />
				  <view style="height: 72rpx;"/>
				<van-button block type="danger" round @click="confirm">确认</van-button>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				remark: undefined
			}
		},
		computed: {
			height() {
				return this.scrollviewHeilght - 46 + 'px'
			}
		},
		onLoad({remark}) {
			this.remark = remark;
		},
		methods: {
			confirm() {
				if(!this.remark) {
					this.$slTip('备注是空的~');
					return
				}
				uni.$emit('handleRemark', this.remark);
				this.$back();
			},
			handleChange({detail}) {
				this.remark = detail;
			}
		}
	}
</script>

<style>
</style>
